<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8">
        <title>更新页面</title>
        <link rel="stylesheet" href="/app/admin/component/pear/css/pear.css" />
        <link rel="stylesheet" href="/app/admin/component/jsoneditor/css/jsoneditor.css" />
        <link rel="stylesheet" href="/app/admin/admin/css/reset.css" />
        
    </head>
    <body>

    <!-- 数据表格 -->
    <div class="layui-card">
        <div class="layui-card-body">
            <table id="data-table2" lay-filter="data-table2"></table>
        </div>
    </div>

        <script src="/app/admin/component/layui/layui.js?v=2.8.12"></script>
        <script src="/app/admin/component/pear/pear.js"></script>
        <script src="/app/admin/component/jsoneditor/jsoneditor.js"></script>
        <script src="/app/admin/admin/js/permission.js"></script>
        <script src="/app/admin/admin/js/functions.js"></script>
        <script src="/app/admin/admin/js/md5.js"></script>
        
        <script>
            let table;
            // 相关接口
            const PRIMARY_KEY = "id";
            const PRIMARY_KEY_VALUE = layui.url().search[PRIMARY_KEY];
            const SELECT_API = "/app/admin/user/video/partsdetail" + location.search;
            let where = {"id":PRIMARY_KEY_VALUE};

            layui.use(["table", "form", "common", "popup", "util"], function() {
                table = layui.table;
                table.render({
                    elem: "#data-table2",
                    url: SELECT_API,
                    page: true,
                    headers: get_header(where),
                    skin: "line",
                    size: "lg",
                    cols: [[ //表头
                        {field: 'id', title: '行号',width:100}
                        , {field: 'content', title: '分段内容'}
                        , {field: 'subtitles', title: '字幕',templet: function (d) {
                            let text = '';
                             layui.$.each(d.subtitles,function (i,v) {
                                 if(i==0){
                                     text += v;
                                 }else{
                                     text += '<span style="color: red"> || </span>'+v;
                                 }
                             })
                             return text;
                         }}
                    ]]
                    , limit: 100
                    , page: false

                });

            });

        </script>

    </body>

</html>
